#include<iostream>
#include<string>
using namespace std;
int main(){
  string mom,son="luogu";
  cin>>mom;
  int time=0;
   int p=mom.find(son);
  while(p!=-1){
    time++;
    p=mom.find(son,p+1);
  }
  cout<<time;
}